package cn.springcloud.provider.controller;


import cn.springcloud.api.model.User;
import cn.springcloud.provider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController {

    @Autowired
    private UserService userService ;

    @PostMapping("login")
    @ResponseBody
    public User login(User user){

        User byName = userService.findByName(user.getUserName());

        return byName ;
    }





}
